1. Field of the Invention
The invention relates to a power management system in a computer, and more particularly, to a power management system for hibernating a computer.
2. Description of the Related Art
Personal computers are constantly evolving to provide a user with the highest performance available at the lowest cost. Performance improvements in the microprocessor, memory and data storage systems have resulted in personal computers so powerful that they are now capable of performing tasks that before could only be performed by large mainframe computers. The proliferation of personal computers is driven in part by the ever increasing performance of the electronic components and by the ever dropping prices of the computers.
Technological changes are especially exemplified in the area of portable and palmtop computers where power consumption efficiency needs to be balanced against features, cost, size, weight and performance. This is especially challenging since many computer users desire the portable computer be compact, lightweight and yet provide the same processing power as that of a desktop unit so that compute intensive applications, such as computer aided design, three dimensional animation, and video presentations, can be performed even if the user is on the road and does not have access to his or her desktop computer.
One problem associated with battery powered portable computer systems is the operating period per set of batteries. Although portable computer users prefer long operating time between battery recharge or replacement operations, the weight and space limits imposed by the physical structure of the portable computer provide a natural limit to the operating period that a set of battery can support. Many solutions have been proposed to reduce power consumption of a portable computer system, particularly when the system is not in use.
One solution used in portable computers with Intel's 486.TM. SL microprocessor provides a suspend hardware which allows the system to power-off with an application running after a predetermined period of user inactivity and resume the application transparently when the user continues work using the portable computer. In accordance with the Intel 486.TM. SL data sheet, the suspend mode is the maximum power saving mode as it eliminates all power usage except that required to retain the state of the computer system before power is removed. In the Intel 486.TM. SL system, before causing the computer system to enter the suspended mode, a suspend request handler saves the state of the computer memory such that the computer can return to the state it was in before the power down operation. In addition, register contents of the processor and peripheral components such as the 82360SL I/O chip need to be extracted from the components and saved either in a nonvolatile RAM because the contents of these registers may be overwritten by a system management interrupt handler for resuming operation on the portable computer. Thus, for example, the 82360SL I/O chip contains certain standard ISA peripheral controllers, some of which have only write-only registers. For compatibility reasons, these registers cannot be modified. Therefore, these registers are shadowed in the 82360SL I/O chip such that their states can be accurately restored in the resume function. Thus, in addition to primary memory contents, the suspend code has to save the state of the registers of the processor as well as support chips for the resumption of processing when the computer is woke up.
In the event that the system is in suspension, activities directed at the computer, such as the assertion of the suspend/resume button pin or the opening of the lid of the computer, initiate a resume operation to remove the computer system from its suspend state. When a resume operation is initiated, the 82360SL chip restarts the CPU clock and causes a soft reset. During warm-boot, by examining the suspend status bit, the system BIOS can determine if a reset had been caused by a resume event. If the suspend status bit is set, the reset is a resume reset and control is passed to the system management interrupt (SMI) handler. In this manner, in the Intel 486.TM. SL, information saved by nonvolatile memory before the suspend operation is used by the SMI handler to restore the system to its original state prior to suspend.
Since the Intel 486.TM. SL suspend specification, computer vendors have added a variation known as hibernation where the contents of memory as well as the registers of the processor and support chips are stored in a disk file known as a hibernation file. The ability to store the hibernation file in the disk drive allows much larger system configurations to be stored, such as much multimegabyte main memory size, high resolution video memory, and related information to be economically stored in the computer system's already available disk drive. By using the disk drive in place of the non-volatile RAM, the computer system can hibernate even if memory intensive applications are loaded into memory. Further, by using an existing disk drive rather than adding an expensive non-volatile memory devices, the price of the computer system is kept minimal.
In conventional portable computers offering the hibernation capability, the hibernation trigger is typically activated after a fixed time interval or period of inactivity from the user. Although this solution is adequate when the battery pack powering the portable computer is fresh with an abundance of energy for supporting the operation of the disk drive, one problem with the conventional hibernation approach occurs when the battery pack is near its exhaustion point. At this point, not only do present systems write the hibernation file, they also preclude any further user activity--i.e., shut down. But, in high end portable computers where the main random access memory capacity may reach up to 150 MB, the hibernation file can be expected to be large. The writing of such large file to the disk drive can consume a significant amount of time and energy. Thus, it is possible for the portable computer system to run out of energy in the midst of writing the hibernation file to the disk drive if the remaining battery capacity of the battery is sufficiently low. Such an occurrence would be highly undesirable as the user may lose his or her data during the hibernation process. To forestall this, present solutions hibernate and shut down a predetermined period of time or energy before the batteries lose all power, where the time or energy is chosen to accommodate the maximum expected amount of random access memory to be placed in the system.